﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Common;
using Common.Views;

namespace BusinessLayer2
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IProductServices" in both code and config file together.
    [ServiceContract]
    public interface IProductServices
    {
        [OperationContract]
        IEnumerable<Product> GetAllProducts();

        [OperationContract]
        IEnumerable<Product> Search(int category, string name, int LeastPrice, int MaxPrice);

        [OperationContract]
        void UpdateProduct(Common.Product p);

        [OperationContract]
        Common.Product GetProductByID(int id);

        [OperationContract]
        void AddRating(UserProductRating u);

        [OperationContract]
        IEnumerable<Category> GetAllCategories();

        [OperationContract]
        void AddToCart(string username,int productID, int quantity);

        [OperationContract]
        List<Common.Cart> GetItemsInShoppingCart(string username);

        [OperationContract]
        int GetNoOfItemsInShoppingCart(string username);

        [OperationContract]
        void AddOrderDetails(Common.OrderDetail od);

        [OperationContract]
        void RemoveProductFromCart(int Id);

        [OperationContract]
        List<Common.Comment> getComments(int ProductID);
       
        [OperationContract]
        void addComment(Common.Comment c);

        [OperationContract]
        Common.VIews.UserItem GetUserProductsDetails(string username,int id);

        [OperationContract]
        IEnumerable<Common.VIews.UserItem> GetUserProducts(string username);

        [OperationContract]
        void AddOrder(Common.Order o);

        [OperationContract]
        void DeleteCart(int id);

        [OperationContract]
        IEnumerable<Common.VIews.UserItem> GetUserProductsForFaults(string username);

        [OperationContract]
        IEnumerable<Product> GetAllUserProducts(string username);

        [OperationContract]
        Common.Views.ProductDetails GetProductDetailsByID(int id, string username);

        [OperationContract]
        IEnumerable<OrderDetail> GettAllOrdersDetails();

        [OperationContract]
        IEnumerable<UserProductRating> getAllRatings();

        [OperationContract]
        string PDFOrder(Guid orderId);

        [OperationContract]
        Order GetOrderByID(Guid ID);

        [OperationContract]
        OrderDetail GetOrderDetailByID(int id);

        [OperationContract]
        IEnumerable<OrderDetail> GetOrderDetailByOrderID(Guid id);

        [OperationContract]
        void UpdateOrderDetail(OrderDetail od);

        [OperationContract]
        IEnumerable<Order> GetAllOrderByUserName(string username);

        [OperationContract]
        void ProduceReport(List<ProductReport> list, string opt);

    }
}
